import pygame
from ui import window
from config import config, uiconfig

# font object
basic_font_36 = pygame.font.SysFont(uiconfig.BASIC_FONT, 36)
basic_font_24 = pygame.font.SysFont(uiconfig.BASIC_FONT, 24)
basic_font_20 = pygame.font.SysFont(uiconfig.BASIC_FONT, 20)
basic_font_12 = pygame.font.SysFont(uiconfig.BASIC_FONT, 12)


def loadimg(path: str):
    imgobj = pygame.image.load(path)
    if config.HW_SURFACE:
        return imgobj.convert_alpha()
    else:
        return imgobj


def main():
    global new_file, open_file, input_file
    global file_menu, map_menu, anim_menu, output_menu
    global save_icon
    global msg_bg, msg_ok, msg_cancel

    # start image
    new_file = loadimg("src/img/new.png")
    open_file = loadimg("src/img/open.png")
    input_file = loadimg("src/img/input.png")

    # menu icon
    file_menu = loadimg("src/img/file.png")
    map_menu = loadimg("src/img/map.png")
    anim_menu = loadimg("src/img/animation.png")
    output_menu = loadimg("src/img/output.png")

    # global button icon
    save_icon = loadimg("src/img/save.png")

    # msg icon
    msg_bg = loadimg("src/img/msg_bg.png")
    msg_ok = loadimg("src/img/msg_ok.png")
    msg_cancel = loadimg("src/img/msg_cancel.png")
